Goes to room r with no fade and no transition, so the player does not see it happen. This instance and the camera come through moved by (offset_x, offset_y) - new place = old place + offset - which is what keeps the picture the same on both sides. The optional fourth value, carry_within (pixels, 0 when left out), also carries every instance within that distance of this one, moved the same way.
Works differently on Game Boy - On the Game Boy this is a quick cut: the object and the camera keep their place in the new room, but the screen may blank for a moment while the room loads.
Works differently on Game Boy Color - On the Game Boy Color this is a quick cut: the object and the camera keep their place in the new room, but the screen may blank for a moment while the room loads.
Works differently on Sega Genesis - The Sega Genesis makes a seamless room change keep the picture whole: the old picture stays on the screen until the new room is ready, and the new one comes in one piece, with no black frame. What it needs: the offset is a whole number of squares (a multiple of 8 pixels), the two rooms are joined by a seamless change in the project (they then share one set of tiles in video memory, so together they must not use more tiles than the layers have), both draw painted tiles on the same layers, no layer is drawn in line-scroll bands, and the new room's edge does not move the camera. A layer that scrolls at another speed than 100 percent moves a whole number of squares only where the offset makes it so. A change the layers cannot make whole is made the plain way instead: the room's own transition, and nothing is carried. A cell the two rooms draw alike is not written again, so what changes at the seam costs one blank of transfers: about 16 runs of cells.
On other consoles this differs: see Side by side and How the consoles differ.
room_change_seamless(r, offset_x, offset_y, carry_within = 0)| Name | Type |
|---|---|
r | room |
offset_x | real |
offset_y | real |
carry_within | real (can be left out; then it is 0) |
Nothing.
Goes to room r with no fade and no transition, so that the player does not see the room change at all. The instance that made the call and the camera come through into the new room moved by (offset_x, offset_y): its new place is its old place plus the offset, and the camera moves by the same amount. An optional fourth value, carry_within, takes the instances around it along too. That is what keeps the picture the same on both sides of the change.
It is the same change a cutscene's Go to Room step makes when its Seamless box is on, and it works the same way. The room does not change at once: it changes at the start of the next frame, and the old picture stays on the screen until the new room is completely built, so there is no black frame and no half-drawn room.
What comes through. The instance that made the call, with every value it holds just as it was (its Create event does not run again), and the camera, which keeps following whatever it followed. Nothing else is carried unless you ask (below): every other instance of the old room is cleared as in any room change, except the persistent ones, which come through where they stand and are not moved. If the new room places its own copy of the object that makes the call, there are two of it after the change, so a room that is only ever reached this way should not place one.
Taking the others along: carry_within. Give the call a fourth value, a distance in pixels, and every instance of any object whose place is within that distance of the instance that made the call (measured in a straight line, from its place to theirs) comes through with it. Each one is moved by the same (offset_x, offset_y), keeps every value it holds, and does not run its Create event again, so to the player the whole crowd around them simply stays where it is on the screen. Leave the fourth value out, or give 0, and only the instance that made the call comes through, exactly as before.
offset_x and offset_y are amounts, not places: they are added to where the instance and the camera are now, so the same call works wherever it is made. To step into the room to the east of a room that is 480 wide, with the neighbors' floor painted so that the east half of one room is the west half of the next, call it with an offset of -240.
The call does nothing if r is not a room of the game, or if a seamless change or a transition is already in progress. Called from a room's own Create code there is no instance to carry, so only the camera comes through.
Only some consoles can change room without a break. If your game is for one that cannot, the editor tells you when you write the call and the game will not build; use room_change or room_change_ext, which play a transition, instead.
if (x > room_width() - 120) {
room_change_seamless(room_doc_arena, -240, 0);
}When this instance walks into the right-hand border of the room, goes to room_doc_arena with no break. It arrives 240 pixels to the left of where it is now, and the camera moves 240 to the left with it, so the picture does not change.
room_change_seamless(room_doc_arena, 0, 160);Goes to room_doc_arena with this instance and the camera 160 pixels lower in the new room than they are now.
room_change_seamless(room_doc_arena, -240, 0, 160);The same change as the first example, and every instance of any object within 160 pixels of this one comes through with it, 240 pixels to the left of where it stood, so everything on the screen stays where it was.
The change happens at the start of the next frame, and the old picture stays on the screen until the new room is completely built, so there is no black frame and no half-drawn room. What comes through: the instance that made the call (every value it holds stays as it was, and it does not run its Create event again) and the camera, which keeps following whatever it followed. With carry_within greater than 0, every instance of any object whose place is within that many pixels of this instance (a straight line, middle to middle) comes through too, moved by the same offset, keeping every value and not running its Create event again; a persistent instance within that distance is carried and moved as well. They take their places in the object pools, so the instances the new room makes itself come after them, and one that no longer fits is not made (as with any full pool; never a crash). At most 24 kinds of object cross at once; a kind beyond that is left behind. Without carry_within nothing else is carried: every other instance of the old room is cleared as in any room change, except the persistent ones, which come through where they are, not moved. For the picture to be the same, the two rooms must look the same where the screen is at the moment of the change (the Seamless Go to Room step of a cutscene checks that for you; a call in code is not checked). Does nothing if r is out of range, if a seamless change or a transition is already in progress, A call made from a room’s own Create code changes the room too, but there is no instance to carry, so only the camera comes through.